#include <stdio.h>

int main(void)
{
	int y, m, d;

	scanf("%d%d%d", &y, &m, &d);

	int cnt = 0;

	switch (m - 1)
	{
		case 11:
			cnt += 30;
		case 10:
			cnt += 31;
		case 9:
			cnt += 30;
		case 8:
			cnt += 31;
		case 7:
			cnt += 31;
		case 6:
			cnt += 30;
		case 5:
			cnt += 31;
		case 4:
			cnt += 30;
		case 3:
			cnt += 31;
		case 2:
			cnt += (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) ? 29 : 28;
		case 1:
			cnt += 31;
	}

	cnt += d;
	
	printf("%d年%d月%d日是该年第%d天\n", y, m, d, cnt);

}
